package day0325;

public class Test3 {
    public static void main(String[] args) {
        Test3.getCarCount(41,127);
    }


    public static void getCarCount(int   carCount,   int  wheelCount ) {
        //41车，  127/3轮子     摩托有三个轮子
        for (int car = 0; car <  Math.min(carCount ,wheelCount/4)  ; car++) {
            for (int m = 0; m < Math.min(carCount ,wheelCount/3) ; m++) {
                if(  (car+m==carCount)&&(4*car + 3*m ==wheelCount)  ){
                    System.out.println("汽车的数量："+car+",摩托的数量："+m);
                }
            }
        }
    }
//休息


}
